package burubaka.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2012-05-04 21:41:09")
/** */
public final class RaceInfoMeta extends org.slim3.datastore.ModelMeta<burubaka.model.RaceInfo> {

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date> createdDate = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date>(this, "createdDate", "createdDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Integer> currentFlg = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Integer>(this, "currentFlg", "currentFlg", int.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date> deadline = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date>(this, "deadline", "deadline", java.util.Date.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> districtClass = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "districtClass", "districtClass");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> kaisaiNo = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "kaisaiNo", "kaisaiNo");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Integer> progress = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Integer>(this, "progress", "progress", int.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceDate = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceDate", "raceDate");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceInfo1 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceInfo1", "raceInfo1");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceInfo2 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceInfo2", "raceInfo2");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceInfo3 = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceInfo3", "raceInfo3");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceName = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceName", "raceName");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceNo = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceNo", "raceNo");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo> raceURL = new org.slim3.datastore.StringAttributeMeta<burubaka.model.RaceInfo>(this, "raceURL", "raceURL");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date> startTime = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.util.Date>(this, "startTime", "startTime", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<burubaka.model.RaceInfo, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    private static final RaceInfoMeta slim3_singleton = new RaceInfoMeta();

    /**
     * @return the singleton
     */
    public static RaceInfoMeta get() {
       return slim3_singleton;
    }

    /** */
    public RaceInfoMeta() {
        super("RaceInfo", burubaka.model.RaceInfo.class);
    }

    @Override
    public burubaka.model.RaceInfo entityToModel(com.google.appengine.api.datastore.Entity entity) {
        burubaka.model.RaceInfo model = new burubaka.model.RaceInfo();
        model.setCreatedDate((java.util.Date) entity.getProperty("createdDate"));
        model.setCurrentFlg(longToPrimitiveInt((java.lang.Long) entity.getProperty("currentFlg")));
        model.setDeadline((java.util.Date) entity.getProperty("deadline"));
        model.setDistrictClass((java.lang.String) entity.getProperty("districtClass"));
        model.setKaisaiNo((java.lang.String) entity.getProperty("kaisaiNo"));
        model.setKey(entity.getKey());
        model.setProgress(longToPrimitiveInt((java.lang.Long) entity.getProperty("progress")));
        model.setRaceDate((java.lang.String) entity.getProperty("raceDate"));
        model.setRaceInfo1((java.lang.String) entity.getProperty("raceInfo1"));
        model.setRaceInfo2((java.lang.String) entity.getProperty("raceInfo2"));
        model.setRaceInfo3((java.lang.String) entity.getProperty("raceInfo3"));
        model.setRaceName((java.lang.String) entity.getProperty("raceName"));
        model.setRaceNo((java.lang.String) entity.getProperty("raceNo"));
        model.setRaceURL((java.lang.String) entity.getProperty("raceURL"));
        model.setStartTime((java.util.Date) entity.getProperty("startTime"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("createdDate", m.getCreatedDate());
        entity.setProperty("currentFlg", m.getCurrentFlg());
        entity.setProperty("deadline", m.getDeadline());
        entity.setProperty("districtClass", m.getDistrictClass());
        entity.setProperty("kaisaiNo", m.getKaisaiNo());
        entity.setProperty("progress", m.getProgress());
        entity.setProperty("raceDate", m.getRaceDate());
        entity.setProperty("raceInfo1", m.getRaceInfo1());
        entity.setProperty("raceInfo2", m.getRaceInfo2());
        entity.setProperty("raceInfo3", m.getRaceInfo3());
        entity.setProperty("raceName", m.getRaceName());
        entity.setProperty("raceNo", m.getRaceNo());
        entity.setProperty("raceURL", m.getRaceURL());
        entity.setProperty("startTime", m.getStartTime());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        burubaka.model.RaceInfo m = (burubaka.model.RaceInfo) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        writer.setNextPropertyName("currentFlg");
        encoder0.encode(writer, m.getCurrentFlg());
        burubaka.common.coder.DateCoder encoder1 = new burubaka.common.coder.DateCoder();
        if(m.getDeadline() != null){
            writer.setNextPropertyName("deadline");
            encoder1.encode(writer, m.getDeadline());
        }
        if(m.getDistrictClass() != null){
            writer.setNextPropertyName("districtClass");
            encoder0.encode(writer, m.getDistrictClass());
        }
        if(m.getKaisaiNo() != null){
            writer.setNextPropertyName("kaisaiNo");
            encoder0.encode(writer, m.getKaisaiNo());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder0.encode(writer, m.getKey());
        }
        writer.setNextPropertyName("progress");
        encoder0.encode(writer, m.getProgress());
        if(m.getRaceDate() != null){
            writer.setNextPropertyName("raceDate");
            encoder0.encode(writer, m.getRaceDate());
        }
        if(m.getRaceInfo1() != null){
            writer.setNextPropertyName("raceInfo1");
            encoder0.encode(writer, m.getRaceInfo1());
        }
        if(m.getRaceInfo2() != null){
            writer.setNextPropertyName("raceInfo2");
            encoder0.encode(writer, m.getRaceInfo2());
        }
        if(m.getRaceInfo3() != null){
            writer.setNextPropertyName("raceInfo3");
            encoder0.encode(writer, m.getRaceInfo3());
        }
        if(m.getRaceName() != null){
            writer.setNextPropertyName("raceName");
            encoder0.encode(writer, m.getRaceName());
        }
        if(m.getRaceNo() != null){
            writer.setNextPropertyName("raceNo");
            encoder0.encode(writer, m.getRaceNo());
        }
        if(m.getRaceURL() != null){
            writer.setNextPropertyName("raceURL");
            encoder0.encode(writer, m.getRaceURL());
        }
        if(m.getStartTime() != null){
            writer.setNextPropertyName("startTime");
            encoder1.encode(writer, m.getStartTime());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder0.encode(writer, m.getVersion());
        }
        writer.endObject();
    }

    @Override
    protected burubaka.model.RaceInfo jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        burubaka.model.RaceInfo m = new burubaka.model.RaceInfo();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("currentFlg");
        m.setCurrentFlg(decoder0.decode(reader, m.getCurrentFlg()));
        reader = rootReader.newObjectReader("deadline");
        burubaka.common.coder.DateCoder decoder1 = new burubaka.common.coder.DateCoder();
        m.setDeadline(decoder1.decode(reader, m.getDeadline()));
        reader = rootReader.newObjectReader("districtClass");
        m.setDistrictClass(decoder0.decode(reader, m.getDistrictClass()));
        reader = rootReader.newObjectReader("kaisaiNo");
        m.setKaisaiNo(decoder0.decode(reader, m.getKaisaiNo()));
        reader = rootReader.newObjectReader("key");
        m.setKey(decoder0.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("progress");
        m.setProgress(decoder0.decode(reader, m.getProgress()));
        reader = rootReader.newObjectReader("raceDate");
        m.setRaceDate(decoder0.decode(reader, m.getRaceDate()));
        reader = rootReader.newObjectReader("raceInfo1");
        m.setRaceInfo1(decoder0.decode(reader, m.getRaceInfo1()));
        reader = rootReader.newObjectReader("raceInfo2");
        m.setRaceInfo2(decoder0.decode(reader, m.getRaceInfo2()));
        reader = rootReader.newObjectReader("raceInfo3");
        m.setRaceInfo3(decoder0.decode(reader, m.getRaceInfo3()));
        reader = rootReader.newObjectReader("raceName");
        m.setRaceName(decoder0.decode(reader, m.getRaceName()));
        reader = rootReader.newObjectReader("raceNo");
        m.setRaceNo(decoder0.decode(reader, m.getRaceNo()));
        reader = rootReader.newObjectReader("raceURL");
        m.setRaceURL(decoder0.decode(reader, m.getRaceURL()));
        reader = rootReader.newObjectReader("startTime");
        m.setStartTime(decoder1.decode(reader, m.getStartTime()));
        reader = rootReader.newObjectReader("version");
        m.setVersion(decoder0.decode(reader, m.getVersion()));
        return m;
    }
}